Skip to content

Hacks to core and point_mode to enable unit tests#151

Draft
djmallum wants to merge 2 commits intoChrismarsh:developfrom
djmallum:hacks/unit-testing
Draft

Hacks to core and point_mode to enable unit tests#151
djmallum wants to merge 2 commits intoChrismarsh:developfrom
djmallum:hacks/unit-testing

Conversation

@djmallum
Copy link
Contributor

@djmallum djmallum commented Jul 17, 2025

Purpose

The purpose of this PR is to start a discussion on point_mode runs in CHM without requiring a mesh. A future version of CHM could have an option to have something like this but not hacky.

Details

The following are changes I made to core.cpp and point_mode to allow the running of a single module within CHM but essentially separetely from it. Manually written mesher file allows fine grained parameter control without needed to deal with built in CHM mesh components.

Currently, to run point_mode one is required to specificy a point in space. In order words, one needs to have a full prepared CHM mesh. These changes allowed for a manually written mesher file and not having to worry about the "mesh" being at a valid grid point.

1073            out.face = _mesh->face(0); 

Takes the first face, and in a 0D (or 1D in the case of vertical processes) face(0) is the only triangle defined in the mesher file.

In point_mode, use of a user defined flag unit_test_new_modules allows for user defined, run specific depends and provides in the constructor and fetching from met files in the run function.

if(unit_test_new_modules)
{
    depends_from_met("SWE");
   provides("swe");
    // and more
};

Note

This point_mode version is made to run modules that don't yet exist in CHM but are in this PR draft.

I intend to include manual mesher file and config file to this PR in the future for clarity.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants